1. Field of the Invention
The present invention relates generally to disk controllers, and more particularly to performing parity checks in disk storage systems using disk controllers.
2. Background
Conventional computer systems typically include several functional components. These components may include a central processing unit (CPU), main memory, input/output (“I/O”) devices, and disk drives. In conventional systems, the main memory is coupled to the CPU via a system bus or a local memory bus. The main memory is used to provide the CPU access to data and/or program information that is stored in main memory at execution time. Typically, the main memory is composed of random access memory (RAM) circuits. A computer system with the CPU and main memory is often referred to as a host system.
The main memory is typically smaller than disk drives and may be volatile. Programming data is often stored on the disk drive and read into main memory as needed. The disk drives are coupled to the host system via a disk controller that handles complex details of interfacing the disk drives to the host system. Communications between the host system and the disk controller is usually provided using one of a variety of standard I/O bus interfaces.
Typically, a disk drive includes one or more magnetic disks. Each disk typically has a number of concentric rings or tracks on which data is stored. The tracks themselves may be divided into sectors, which are the smallest accessible data units. A positioning head above the appropriate track accesses a sector. An index pulse typically identifies the first sector of a track. The start of each sector is identified with a sector pulse. Typically, the disk drive waits until a desired sector rotates beneath the head before proceeding a read or write operation. Data is accessed serially, one bit at a time and typically, each disk has its own read/write head.
The disk drive is connected to the disk controller that performs numerous functions, for example, converting digital data to analog head signals, disk formatting, error checking and fixing, logical to physical address mapping and data buffering. To perform the various functions for transferring data, the disk controller includes numerous components.
A conventional disk drive stores data bytes on disk drive platters in sets of a predetermined length. A disk drive controller or a host computer may generate error correction code (ECC) bytes and cyclic redundancy check (CRC) bytes for each set of data bytes. Sometimes, the host computer generates CRC bytes, and the disk controller generates its own set of CRC bytes. The CRC and the ECC bytes are appended to the end of the set of data bytes. The data bytes, CRC bytes and ECC bytes together make up a ‘sector’, and this sector is stored on the disk platter. When the disk drive controller reads a sector off the disk, the data bytes and CRC bytes are stored in a buffer unit (memory) in the disk drive. An ECC unit detects and corrects errors in the sector read off the platter. These corrections are made to the data bytes and CRC bytes stored in the buffer unit.
Conventional disk array storage systems may have multiple disk drives arranged and coordinated such that a single mass storage system is formed. This allows data to be stored at multiple disks and ensures continued operation if a disk fails. Data may be stored at multiple locations and if one component fails, data may be regenerated from redundant data stored at another component.
One way to achieve this redundancy is by using parity. In parity redundancy, redundant data is stored in one area of the storage system, however, the size of the redundant storage area is less than the remaining storage area used to store the original area.
A RAID (Redundant Array of Independent Disks) storage system is one technique, which is used to store redundant data. RAID includes various architectures, designated as RAID0, RAID1, RAID 2, RAID 3, RAID 4, and RAID 5.
A RAID 0 system is configured without any redundancy. RAID 1 has mirror redundancy.
RAID 2 through RAID 5 involves parity type redundant storage. For example, in RAID 5, the disks are divided into equally sized address areas (“blocks”) and a set of blocks is referred to as “stripes”. Each stripe has N blocks of data and one parity block, which contains redundant information.
Typically, to update a parity drive, old data from a storage media and new data for a write operation is compared (also referred to as XORed). The XOR operation is used to maintain data integrity.
FIG. 2A shows a simple example of a RAID topology that can use one aspect of the present invention, discussed below. FIG. 2 shows a RAID controller 220A coupled to plural disks 301, 302, 303 and 304 using ports 305 and 306. Data may be written from RAID system 300 to a host system 200 or vice-versa via RAID controller 220A.
One way to maintain data integrity is to use the CRC code. A typical circuit employing CRC error checking includes a CRC checker to verify integrity for old data and a CRC generator that generates CRC information for any new data.
Conventional techniques regenerate CRC on XOR data using logical block address (“LBA”) values. CRC is typically seeded with an LBA value that helps protect against mis-positioning errors in ID-less sector formats. Usually the firmware (code operating the disk controller) knows the LBA for the sector involved and can preset a counter that is linearly updated as each sector is XOR'ed. When Skip operations are used, more firmware intervention will be required, since skip operations present discontinuities in the LBA progression. Conventional systems use firmware to handle the complexity involved in skip operations. However, this solution is slow and hence is not commercially desirable.
Another drawback in the conventional techniques is that any failure in the XOR logic goes undetected because CRC is regenerated on XOR data using logical block address (“LBA”) values.
Therefore, what is desired is a system and method for efficiently performing XOR operation for maintaining data integrity.